package cn.fayang.ymcc.feignclient;

import cn.fayang.ymcc.domain.Login;
import cn.fayang.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginFeginClientSentinel implements FallbackFactory<LoginFeginClient> {
    @Override
    public LoginFeginClient create(Throwable throwable) {
        return new LoginFeginClient() {
            @Override
            public JSONResult save(Login login) {
                throwable.printStackTrace();
                return JSONResult.error("uaa服务不可达");
            }
        };
    }
}
